<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="/static/css/base.css">
  <link rel="stylesheet" href="/static/css/index.css">
  <link rel="stylesheet" href="/static/css/cart.css">
</head>
<body>
  <div class="container header">
    购物车
    <span>
      {{ if userInfo }}
      <div class="avatar">
        <img src="{{ userInfo.avatar }}">
        <p>{{ userInfo.nickname }}</p>
      </div>
      <ul class="options">
        <li><a href="/pages/info">个人中心</a></li>
        <li>注销登录</li>
      </ul>
      {{ else }}
      <a href="/pages/login">请登录</a>
      {{ /if }}
    </span>
  </div>

  <div class="nav container">
    <a href="/pages/goods">&lt;&lt; 商品列表</a>
  </div>

  <div class="cart_box">
    {{ if !cartList.length }}
    <div class="empty">
      <p>呜呜呜呜~~~ · 购物车是空的 (╥╯^╰╥) </p>
      <p>快去花钱买快乐吧~~~~<a href="/pages/goods">去购物 &gt;&gt;</a></p>
      <img src="/public/images/001.webp" alt="">
    </div>
    {{ else }}
    <div class="full">
      <div class="top">
        <input class="select_all" type="checkbox"> 全选
      </div>
      <ul>
        {{ each cartList }}
        <li>
          <div class="select">
            <input data-id="" class="select_item" type="checkbox">
          </div>
          <div class="show">
            <img src="{{ $value.goods_img }}" alt="">
          </div>
          <div class="title">
            {{ $value.goods_title }}
          </div>
          <div class="price">
            ￥ <span>{{ $value.goods_price.toFixed(2) }}</span>
          </div>
          <div class="number">
            <button data-id="" class="item_sub">-</button>
            <input type="text" value="{{ $value.goods_num }}">
            <button data-id="" class="item_add">+</button>
          </div>
          <div class="sub">
            ￥ <span></span>
          </div>
          <div class="destory">
            <button data-id="" class="item_del">删除</button>
          </div>
        </li>
        {{ /each }}
      </ul>
      <div class="bottom">
        <p>总件数 :</p>
        <div class="btns">
          <button class="pay">去支付</button>
          <button class="clear_completed">删除所有已选中</button>
          <button class="clear">清空购物车</button>
        </div>
        <p>总价格 : ￥ <span></span></p>
      </div>
    </div>
    {{ /if }}
  </div>

  <script src="/static/vander/jquery/jquery.min.js"></script>
  <script src="/static/vander/swiper/swiper-bundle.min.js"></script>
  <script src="/static/js/index.js"></script>
</body>
</html>
